layui.define(['table', 'form'], function(exports){
  var $ = layui.$,table = layui.table,form = layui.form;

  var tradeNo = $('input[name="tradeNo"]').val();
  var createDate = $('input[name="createDate"]').val();

  table.render({
    elem: '#LAY-table'
    ,url: layui.setter.webRoot + '/member/recharge/operate/list.data'
      ,where:{tradeNo:tradeNo,createDate:createDate}
    ,method: 'post'
    ,parseData: function (res) {
        return {
            "code": res.code,
            "msg": res.msg,
            "count": res.body.total,
            "data": res.body.data
        };
    }
    ,response: {statusCode: 200}
    ,cols: [[
        {field: 'createDate',width:170,title: '操作时间'}
      ,{field: 'content',title: '操作内容'}
      ,{field: 'programTypeName', width:100,title: '处理程序'}
      ,{field: 'operatorType', width:100,title: '操作人类型',templet:function (record){
              return "["+record.operatorTypeName+"]" + record.operator;
        }}
      ,{field: 'state', title: '状态',templet:function (record){
              if(record.state == 1){
                  return "成功";
              }else {
                  return "失败（"+record.errorMsg+"）";
              }
        }}
    ]]
    ,page: true
    ,limit: 30
    ,height: 'full'
    ,text: '对不起，加载出现异常！'
  });
  
  //事件
  var active = {

  };
  
  $('.layui-btn.LAY-btn-fun').on('click', function(){
    var type = $(this).data('type');
    active[type] ? active[type].call(this) : '';
  });
  
  table.on('tool(LAY-table)', function(obj){
  	var type = obj.event ;
   	active[type] ? active[type].call(this,obj) : '';
  });
  
  exports('member_order_recharge_info', {})
});